;(function () {
    new Vue({
      el: '#preview-list',
      data: {
        data: {},
        isImage: ['.jpg', '.jpeg', '.gif', '.png', '.bmp'],
        title: unescape(hlUrlUtil.GetQueryString('title'))
      },
      methods: {
        getinfo () {
          hlhttp.get({
            url: 'jwk/park_service',
            data: {park_service_id: hlUrlUtil.GetQueryString('portalArticleId')},
            success: (data) => {
              $('.html-preview').html(data.content)
              this.data = {
                title: data.serviceName,
                memo: data.memo,
                files: []
              }
              for(var i = 0;i<= data.attachmentNames.length;i++){
                this.data.files.push({
                    name:data.attachmentNames[i],
                    url:data.attachmentUrls[i]
                })
              }
            }
          })
        },
        back () {
          hlUrlUtil.goTo('jwkParkService',{ddtab: true},false)
          window.location.reload()
        }
      },
      created () {
        if (!hlUrlUtil.GetQueryString('clear')) {
          this.data = JSON.parse(window.sessionStorage.getItem('previewInfo'))
        }
      },
      mounted () {
        if (!hlUrlUtil.GetQueryString('clear')) {
          $('.html-preview').html(this.data.content)
        }
        if (hlUrlUtil.GetQueryString('portalArticleId')) {
          this.getinfo()
        }
      }
    })
  } ())
